<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
	  xmlns:ui="http://java.sun.com/jsf/facelets"
	  xmlns:h="http://java.sun.com/jsf/html"
	  xmlns:f="http://java.sun.com/jsf/core">
	<head><title>IGNORED</title></head>
	<body>
		<ui:composition template="../templates/layout.xhtml">
			<ui:define name="windowTitle">Daily Market | Partners | #{dealBean.populated ? "Change" : "Create New"} Deal</ui:define>
			<ui:define name="extra_css"><h:outputStylesheet library="css" name="anytime.css" /></ui:define>
			<ui:define name="extra_js"><h:outputScript library="js" name="anytime.js" /></ui:define>
			<ui:define name="logoImage"><h:graphicImage library="images" name="logo_header.jpg" alt="logo" /></ui:define>
			<ui:define name="content">
				<script type="text/javascript" src="../resources/js/tiny_mce/tiny_mce.js" ></script>
				<script type="text/javascript">
tinyMCE.init({
        mode : "textareas",
        theme : "advanced",
		theme_advanced_toolbar_location : "top",
		theme_advanced_toolbar_align : "left",
        width : "680",
        height : "360"
 });
				</script>
				<h:form id="deal_editor_form">
					<div id="deal_editor_header" class="graphic_bg">
						<div id="deal_editor_buttons">
							<h:link styleClass="image-button no-height" outcome="manage_images"><h:graphicImage library="images/icons/16" name="photos.png" alt="i" title="Manage Images" />Manage Images</h:link>
							<h:link styleClass="image-button no-height" outcome="#{dealList.cancelEditDeal}"><h:graphicImage library="images/icons/16" name="cancel.png" alt="c" title="Cancel" styleClass="with-text" />Cancel</h:link>
							<a href="Javascript:;" onclick="do_check_save();" class="image-button no-height"><h:graphicImage library="images/icons/16" name="page_save.png" alt="s" title="Save" styleClass="with-text" />Save</a>
							<h:commandLink action="#{dealList.doSaveDeal}" id="deal_save_action" style="display: none; visibility: hidden;" />
						</div>
						<h:outputText value="#{dealList.existingDeal ? 'Edit Deal Offer' : 'New Deal Offer'}" />
					</div>
					<h:panelGroup styleClass="notification error" rendered="#{dealList.dealBean.locked}">This deal is locked because it is currently in progress.</h:panelGroup>
					<h:messages globalOnly="true" styleClass="form-messages" fatalClass="form-messages error" errorClass="form-messages error" warnClass="form-messages warn" infoClass="form-messages good" />
					<div id="deal_editor_content_left" class="graphic_bg">
						<div class="form-row">
							<h:outputLabel for="deal_company" value="#{msgs.deal_editor_company}" styleClass="form-row" />
							<h:outputText id="deal_company" value="#{dealList.dealBean.companyDisplay}" style="font-weight: bold;" />
						</div>
						<div class="form-row">
							<h:outputLabel for="deal_shortDesc" value="#{msgs.deal_editor_shortDesc}" styleClass="form-row" />
							<h:inputText id="deal_shortDesc" value="#{dealList.dealBean.shortDesc}" required="true" requiredMessage="#{msgs.deal_editor_shortDesc_required}" style="width: 575px;" />
						</div>
						<h:message for="deal_shortDesc" errorClass="form-message error" infoClass="form-message" fatalClass="form-message error" styleClass="form-message" warnClass="form-message warn" />
						<div class="form-row">
							<h:outputLabel for="deal_longDesc" value="#{msgs.deal_editor_longDesc}" styleClass="form-row" />
							<h:inputTextarea id="deal_longDesc" value="#{dealList.dealBean.longDesc}" />
						</div>
					</div>
					<div id="deal_editor_content_right" class="graphic_bg">
						<div class="form-row">
							<h:outputLabel for="deal_unitPrice" value="#{msgs.deal_editor_unitPrice}" styleClass="form-row" />
							<h:inputText id="deal_unitPrice" value="#{dealList.dealBean.price}" required="true" requiredMessage="#{msgs.deal_editor_unitPrice_required}" validatorMessage="#{msgs.deal_editor_unitPtice_invalid}">
								<f:convertNumber type="currency" />
							</h:inputText>
						</div>
						<h:message for="deal_unitPrice" errorClass="form-message error" infoClass="form-message" fatalClass="form-message error" styleClass="form-message" warnClass="form-message warn" />
						<div class="form-row">
							<h:outputLabel for="deal_startTime" value="#{msgs.deal_editor_startTime}" styleClass="form-row" />
							<h:inputText id="deal_startTime" value="#{dealList.dealBean.startTime}">
								<f:convertDateTime type="both" pattern="#{msgs.deal_editor_internal_datetime_format}" timeZone="#{dealList.timeZone}" />
							</h:inputText>
						</div>
						<h:message for="deal_startTime" errorClass="form-message error" infoClass="form-message" fatalClass="form-message error" styleClass="form-message" warnClass="form-message warn" />
						<div class="form-row">
							<h:outputLabel for="deal_timed" value="#{msgs.deal_editor_timed}" styleClass="form-row" />
							<h:selectBooleanCheckbox id="deal_timed" value="#{dealList.dealBean.timed}" onchange="do_update_timed();" />
						</div>
						<div id="timed_deal_params">
							<div class="form-row">
								<h:outputLabel for="deal_duration" value="#{msgs.deal_editor_duration}" styleClass="form-row" />
								<h:selectOneMenu id="deal_duration">
									<f:selectItem itemValue="1" itemLabel="1 Day" />
									<f:selectItem itemValue="2" itemLabel="2 Days" />
									<f:selectItem itemValue="3" itemLabel="3 Days" />
									<f:selectItem itemValue="7" itemLabel="7 Days" />
									<f:selectItem itemValue="30" itemLabel="30 Days" />
									<f:selectItem itemValue="c" itemLabel="Custom" />
								</h:selectOneMenu>
							</div>
							<div class="form-row">
								<h:outputLabel for="deal_endTime" value="#{msgs.deal_editor_endTime}" styleClass="form-row" />
								<h:inputText id="deal_endTime" value="#{dealList.dealBean.endTime}">
									<f:convertDateTime type="both" pattern="#{msgs.deal_editor_internal_datetime_format}" timeZone="#{dealList.timeZone}" />
								</h:inputText>
							</div>
							<h:message for="deal_endTime" errorClass="form-message error" infoClass="form-message" fatalClass="form-message error" styleClass="form-message" warnClass="form-message warn" />
							<div class="form-row">
								<h:outputLabel for="deal_minQty" value="#{msgs.deal_editor_minQty}" styleClass="form-row" />
								<h:inputText id="deal_minQty" value="#{dealList.dealBean.minQty}" size="5" validatorMessage="#{msgs.deal_editor_qty_invalid}">
									<f:convertNumber integerOnly="true" />
								</h:inputText>
							</div>
							<h:message for="deal_minQty" errorClass="form-message error" infoClass="form-message" fatalClass="form-message error" styleClass="form-message" warnClass="form-message warn" />
							<div class="form-row">
								<h:outputLabel for="deal_maxQty" value="#{msgs.deal_editor_maxQty}" styleClass="form-row" />
								<h:inputText id="deal_maxQty" value="#{dealList.dealBean.maxQty}" size="5" validatorMessage="#{msgs.deal_editor_qty_invalid}">
									<f:convertNumber integerOnly="true" />
								</h:inputText>
							</div>
							<h:message for="deal_maxQty" errorClass="form-message error" infoClass="form-message" fatalClass="form-message error" styleClass="form-message" warnClass="form-message warn" />
						</div>
						<div class="form-row">
							<h:outputLabel for="deal_minUserQty" value="#{msgs.deal_editor_minUserQty}" styleClass="form-row" />
							<h:inputText id="deal_minUserQty" value="#{dealList.dealBean.minUserQty}" size="5" validatorMessage="#{msgs.deal_editor_qty_invalid}">
								<f:convertNumber integerOnly="true" />
							</h:inputText>
						</div>
						<h:message for="deal_minUserQty" errorClass="form-message error" infoClass="form-message" fatalClass="form-message error" styleClass="form-message" warnClass="form-message warn" />
						<div class="form-row">
							<h:outputLabel for="deal_maxUserQty" value="#{msgs.deal_editor_maxUserQty}" styleClass="form-row" />
							<h:inputText id="deal_maxUserQty" value="#{dealList.dealBean.maxUserQty}" size="5" validatorMessage="#{msgs.deal_editor_qty_invalid}">
								<f:convertNumber integerOnly="true" />
							</h:inputText>
						</div>
						<h:message for="deal_maxUserQty" errorClass="form-message error" infoClass="form-message" fatalClass="form-message error" styleClass="form-message" warnClass="form-message warn" />
					</div>
				</h:form>
			</ui:define>
		</ui:composition>
	</body>
</html>